import { defHttp } from '@/utils/http';
import { exc, root, sys } from '../apiRoot';
import type { IResData, IQuery } from '../indexTypes';
import type {
  IActivityListData,
  IActivityListResData,
  IEnterForActivityData,
  IPrticipantsListData,
  IPrticipantsListResData,
  IRegistrationStatusRes,
  ISignRegisterData,
  IAppMemberCountRes,
  IAppRegistrationData,
  IAppRegistrationRes,
  ActivityFormGetByIdResult,
  RetinueListResult,
  RetinueAddData,
  AttendanceCardResult,
  FindActivityArrangeListResult,
  ActivityDetailList,
  IOrganizingUnit,
  IActivityCountInfo,
  IActivityRegisterQuery,
  IActivityRegister,
  IActivityRegisterFormItem,
  IActivityTicketResult,
  ActivityCreateSuborderData,
  RegisterPayFormInfoResult,
  RegisterDetailResult,
  ActivityManagerDeviceActListResult,
  ActivityManagerScanVerification,
  ActivityScanVerificationData,
  ActivityScanVerificationResult,
  ActivitySignImgeData,
  ActivityGetSignTypesResult,
  UniongetOrderCodeResult,
  IRankList,
  IRankListQuery,
  IActivityManagerBrowseListQuery,
  IActivityManagerBrowseList,
  IAuditRegisterRefundApplyQuery,
  BrowseDetailList,
  IBrowseListDetailQuery,
  DetailCount,
  InviteDetailList,
  ActivityInviteDetailListQuery,
  ActivityManageInviteDetailList,
  RegisterIdAppUserInfo,
  IReviewNum,
  IActivityReplaceSignData,
  ISearchRegisterListData,
  ISearchRegisterListResult,
  IActivityCancelRecordResult,
  IBigScreenConfig
} from './types';
import type { ApprovalStatusEnum, ShowModeEnum, SignTypeEnum } from '@/enums/activityStatusEnum';
import type { MyOrderListData, MyOrderListReslut } from '../order/types';
import { RoleType } from '@/enums/publicModuleEnum';

export const Api = {
  activityPageList: exc + 'activity/activityPageList',
  myActivityPageList: root + 'activity-form/myActivity/activityPageList',
  activityDetails: root + 'activity/getActivity',
  activityDetailsPreview: root + 'activity/preview',
  prticipantsList: root + 'activity/getActivityRegister',
  enterForActivity: root + 'activity-form/activityForm/registration',
  registrationStatus: root + 'activity/selectRegisterMember',
  attendanceCard: root + 'signAttendanceCard/attendanceCard',
  getActivitySignRegister: root + 'activity/getActivitySignRegister',
  appMemberCount: root + 'activityRegister/appMemberCount',
  appRegistration: root + 'activityRegister/appRegistration',
  activityFormDetails: root + 'activity-form/activityFormDetails',
  retinueList: root + 'app-user-retinue/activity/pageList',
  retinueAdd: root + 'app-user-retinue/add',
  findActivityArrangeList: root + 'activity/findActivityArrangeList',
  getActivityDetailList: exc + 'getActivityDetailList',
  getActivityPartners: exc + 'getActivityPartners',
  getActivityDetailListPreview: exc + 'getActivityPreviewDetailList',
  getActivityPartnersPreview: exc + 'getActivityPreviewPartners',
  activityticketList: root + 'activity/ticket/list',
  activityticketDetail: root + 'activity/ticket/detail',
  cancelActivityRegister: root + 'activity-form/cancelActivityRegister',
  registerDetail: root + 'activity/ticket/registerDetail',
  activityRegisterFormInfo: root + 'activity-form/getRegisterFormInfo',
  activityGetSignTypes: root + 'activity/getSignTypes',
  activityScanVerification: root + 'activity-form/scanVerification',
  activitySignImge: root + 'activity-form/user/signImge',

  activityManagePageList: sys + 'activity-manager/list',
  getActivityCountInfo: sys + 'activity-manager/getActivityCountInfo',
  getActivityRegisterList: sys + 'activity-manager/getActivityRegisterListPost',
  getRegisterRefundApplyPage: sys + 'activity-manager/registerRefundApplyPage',
  activityRegisterFormItem: sys + 'activity-manager/activityRegisterFormItem',
  activityRegisterAudit: sys + 'activity-manager/audit',
  activityManagerRegisterDetail: sys + 'activity-manager/activity/ticket/registerDetail',
  activityManagerCancelSysRegistration: sys + 'activity-manager/cancelSysRegistration',
  activityManagerDeviceActList: sys + 'activity-manager/activity/deviceActList',
  activityManagerPrintChestCard: sys + 'activity-manager/activity/printChestCard',
  activityManagerScanVerification: sys + 'activity-manager/scanVerification',

  activityCreateSuborder: root + 'activity-register-order/union/createSuborder',
  activityCreateorder: root + 'activity-register-order/union/createOrder',
  setHoldRegisterInfo: root + 'activity-register-order/union/setHoldRegisterInfo',
  getHoldRegisterInfo: root + 'activity-register-order/union/getHoldRegisterInfo',
  activityRegisterOrderCancelRegister: root + 'activity-register-order/union/cancelRegister',
  registerArrangeList: root + 'activity-register-order/union/getRegisterArrangeList',
  registerPayFormInfo: root + 'activity-register-order/union/getRegisterPayFormInfo',

  appUserOrderActivityPageList: root + 'app-user-order/activityPageList',

  uniongetOrderCode: root + 'activity-register-order/union/getOrderCode',

  getRankList_user: root + 'activity/invite/rankList',
  getRankList_admin: sys + 'activity-manager/invite/rankList',
  activityManagerBrowseList: sys + 'activity-manager/browseList',
  browseDetailList: sys + 'activity-manager/browseDetailList',
  selectRefundApplyDetail: sys + 'activity-manager/selectRefundApplyDetail',
  auditRegisterRefundApply: sys + 'activity-manager/auditRegisterRefundApply',
  detailCount: root + 'activity/invite/detailCount',
  activityInviteDetailList: root + 'activity/invite/detailList',
  activityManagerInviteBrowseList: sys + 'activity-manager/invite/browseList',
  activityManagerRegistersList: sys + 'activity-manager/registersList',
  activityManagerDetailCount: sys + 'activity-manager/invite/detailCount',
  getByRegisterIdAppUserInfo: root + 'activity/getByRegisterIdAppUserInfo',
  auditCount: sys + 'activity-manager/auditCount',
  activityReplaceSign: sys + 'activity-manager/activity/replace/sign',

  searchRegisterList: root + 'activity/searchRegisterList',

  activityCancelRecord: root + 'activity-form/cancelRecord/list',
  sysActivityCancelRecord: sys + 'activity-manager/cancelRecord/list',

  activityDetailRegisterList: root + 'activity/getActivityDetailRegisterList',

  // 大屏管理相关
  getShowRegisterList: sys + 'activity-union-bi-config/getShowRegisterList',
  getShowRegisterInfo: sys + 'activity-union-bi-config/getShowRegisterInfo',
  switchingMode: sys + 'activity-union-bi-config/switchingMode',
  setShowRegisterInfo: sys + 'activity-union-bi-config/setShowRegisterInfo',
  getBigScreenConfig: sys + 'activity-union-bi-config/getConfig',
  setRedisActivityBIRegisterList: sys + 'activity-union-bi-config/setRedisActivityBIRegisterList',

  // 人脉相关
  appUserConnectionSquare: root + 'app-user-info/appUserConnectionSquare/list',

  // 移动卡领取
  chooseNumberList: root + 'social/worker/choose/number/list',
  addWorker: root + 'social/worker/add',
};
/**
 * 获取活动列表
 * @export
 * @param {IActivityListData} data
 * @return {*}  {Promise<IResData<IActivityListResData>>}
 */
export function activityPageList(data: IActivityListData): Promise<IResData<IActivityListResData>> {
  const { activityStatuss, current, size, title, myActivity, approvalStatus } = data;
  return defHttp.post({
    url: Api.activityPageList + `?current=${current}&size=${size}`,
    data: {
      myActivity,
      title,
      activityStatuss,
      approvalStatus
    },
  });
}

/**
 * @description 我的活动列表
 * @date 03/07/2024
 * @export
 * @param {IActivityListData} data
 * @returns {*}  {Promise<IResData<IActivityListResData>>}
 */
export function myActivityPageList(data: IActivityListData): Promise<IResData<IActivityListResData>> {
  return defHttp.post({
    url: Api.myActivityPageList,
    data,
  });
}

/**
 * 活动管理列表
 * @param data
 * @returns
 */
export function activityManagePageList(data: IActivityListData): Promise<IResData<IActivityListResData>> {
  return defHttp.post({
    url: Api.activityManagePageList + `?current=${data.current}&size=${data.size}`,
    data
  });
}

/**
 * 获取活动详情
 * @param id 活动id/报名id
 * @param type 若是1 id传递为活动id，2则报名id
 * @returns
 */
export function activityDetails(id?: number, shareKey?: string): Promise<IActivityListResData> {
  return defHttp.get({
    url: Api.activityDetails + `/1/${id}`,
    data: {
      shareKey
    }
  });
}

/**
 * 获取活动详情预览
 * @param id 活动id/报名id
 * @returns
 */
export function activityDetailsPreview(id?: number): Promise<IActivityListResData> {
  return defHttp.get({
    url: Api.activityDetailsPreview + `/${id}`,
  });
}

/**
 * 获取活动报名人列表
 * @export
 * @param {IPrticipantsListData} data
 * @return {*}  {Promise<IResData<IPrticipantsListResData>>}
 */
export function prticipantsList(data: IPrticipantsListData): Promise<IResData<IPrticipantsListResData>> {
  const { activityId, current, size } = data;
  return defHttp.get({
    url: Api.prticipantsList + `/${activityId}`,
    data: { current, size },
  });
}

/**
 * @description 获取虚拟活动报名人列表
 * @date 10/09/2024
 * @export
 * @param {number} activityId
 */
export function activityDetailRegisterList(activityId: number) {
  return defHttp.get<IPrticipantsListResData[]>({
    url: Api.activityDetailRegisterList + `/${activityId}`,
  });
}

/**
 * 根据报名id获取卡片信息
 * @param id
 * @returns
 */
export function getByRegisterIdAppUserInfo(id: number) {
  return defHttp.get<RegisterIdAppUserInfo>({
    url: Api.getByRegisterIdAppUserInfo + `/${id}`,
  });
}


/**
 * 活动报名
 * @export
 * @param {IEnterForActivityData} data
 */
export function enterForActivity(data: IEnterForActivityData) {
  return defHttp.post<{ approvalStatus: ApprovalStatusEnum, activityId: number, id: number, userId: number }>({
    url: Api.enterForActivity,
    data,
  });
}

/**
 * 获取报名人针对活动相关的状态
 * @export
 * @param {number} activityId
 * @return {*}  {Promise<IRegistrationStatusRes>}
 */
export function registrationStatus(activityId: number): Promise<IRegistrationStatusRes> {
  return defHttp.get({
    url: Api.registrationStatus + `/${activityId}`,
  });
}

/**
 * @description 获取参会证
 * @date 31/03/2023
 * @export
 * @param {number} activityId
 * @param {string} [signImg]
 */
export function attendanceCard(activityId: number, signImg?: string, equipmentNumber?: string, signType?: SignTypeEnum) {
  return defHttp.post<AttendanceCardResult>({
    url: Api.attendanceCard + `/${activityId}`,
    data: { signImg, equipmentNumber, signType },
  });
}

/**
 * 获取入场名单
 * @export
 * @param {ISignRegisterData} data
 */
export function getActivitySignRegister(data: ISignRegisterData) {
  const { current, size, ...last } = data;
  let url = Api.getActivitySignRegister;
  if (current && size) url = url + `?current=${current}&size=${size}`;
  return defHttp.post({
    url,
    data: last,
  });
}

/**
 * 单位代报名页统计
 * @export
 * @param {{ activityId: number }} data
 * @return {*}  {Promise<IAppMemberCountRes>}
 */
export function appMemberCount(data: { activityId: number }): Promise<IAppMemberCountRes> {
  return defHttp.get({
    url: Api.appMemberCount,
    data,
  });
}

/**
 * 单位代报名页
 * @export
 * @param {IAppRegistrationData} data
 * @return {*}  {Promise<IResData<IAppRegistrationRes>>}
 */
export function appRegistration(data: IAppRegistrationData): Promise<IResData<IAppRegistrationRes>> {
  return defHttp.post({
    url: Api.appRegistration,
    data,
  });
}

/**
 * @description 获取可随行人员列表
 * @date 30/03/2023
 * @export
 * @param {IAppRegistrationData} data
 */
export function retinueList(data: IAppRegistrationData) {
  return defHttp.get<IResData<RetinueListResult>>({
    url: Api.retinueList,
    data
  })
}

/**
 * @description 添加随行人员
 * @date 30/03/2023
 * @export
 * @param {RetinueAddData} data
 */
export function retinueAdd(data: RetinueAddData) {
  return defHttp.post({
    url: Api.retinueAdd,
    data
  })
}



/**
 * @description 获取活动关联的报名表单
 * @date 30/03/2023
 * @export
 * @param {number} activityId
 */
export function activityFormDetails(activityId: number) {
  return defHttp.get<ActivityFormGetByIdResult>({
    url: Api.activityFormDetails + `/${activityId}`
  })
}

/**
 * @description 活动排座信息列表(查自己的)
 * @date 02/07/2024
 * @export
 * @param {{ activityId: number, activityRegisterId: number }} data
 */
export function findActivityArrangeList(data: { activityId: number, activityRegisterId: number }) {
  return defHttp.get<FindActivityArrangeListResult[]>({
    url: Api.findActivityArrangeList,
    data
  })
}

/**
 * @description 订单中根据数据ID查询排座信息
 * @date 02/07/2024
 * @export
 * @param {number} registerdId
 */
export function registerArrangeList(registerdId: number) {
  return defHttp.get<FindActivityArrangeListResult[]>({
    url: Api.registerArrangeList + `/${registerdId}`
  })
}

/**
 * 获取详情富文本列表
 * @param activityId
 * @returns
 */
export function getActivityDetailList(activityId: number) {
  return defHttp.get<ActivityDetailList[]>({
    url: Api.getActivityDetailList,
    data: { activityId }
  })
}
/**
 * 获取详情富文本列表（预览）
 * @param activityId
 * @returns
 */
export function getActivityDetailListPreview(activityId: number) {
  return defHttp.get<ActivityDetailList[]>({
    url: Api.getActivityDetailListPreview,
    data: { activityId }
  })
}

/**
 * 活动举办单位列表
 * @param activityId
 * @returns
 */
export function getActivityPartners(activityId: number) {
  return defHttp.get<IOrganizingUnit[]>({
    url: Api.getActivityPartners,
    data: { activityId }
  })
}

/**
 * 活动举办单位列表（预览）
 * @param activityId
 * @returns
 */
export function getActivityPartnersPreview(activityId: number) {
  return defHttp.get<IOrganizingUnit[]>({
    url: Api.getActivityPartnersPreview,
    data: { activityId }
  })
}

/**
 * 活动统计
 * @param id
 * @returns
 */
export function getActivityCountInfo(id: number) {
  return defHttp.get<IActivityCountInfo>({
    url: Api.getActivityCountInfo + '/' + id,
  })
}

/**
 * 活动报名人员
 * @param data
 * @returns
 */
export function getActivityRegisterList(data: IActivityRegisterQuery) {
  return defHttp.post<IActivityRegister[]>({
    url: Api.getActivityRegisterList,
    data
  })
}

/**
 * 申请退票人员
 * @param data
 * @returns
 */
export function getRegisterRefundApplyPage(data: IActivityRegisterQuery) {
  return defHttp.get<IActivityRegister[]>({
    url: Api.getRegisterRefundApplyPage,
    data
  })
}

/**
 * 报名详情表单
 * @param data
 * @returns
 */
export function activityRegisterFormItem(data: { activityId: number, activityRegisterId: number }) {
  return defHttp.get<IActivityRegisterFormItem>({
    url: `${Api.activityRegisterFormItem}/${data.activityId}/${data.activityRegisterId}`,
    data
  })
}

/**
 * 报名审核
 * @param data
 * @returns
 */
export function activityRegisterAudit(data: { registerId: number, remarks: string, status: ApprovalStatusEnum }) {
  return defHttp.post({
    url: Api.activityRegisterAudit,
    data
  })
}

/**
 * @description 获取票种列表
 * @date 26/06/2024
 * @export
 */
export function activityticketList(activityId: number) {
  return defHttp.get<IActivityTicketResult[]>({
    url: Api.activityticketList,
    data: {
      activityId
    }
  })
}

/**
 * @description 获取票种详情
 * @date 26/06/2024
 * @export
 * @param {number} id 票种ID
 */
export function activityticketDetail(id: number) {
  return defHttp.get<IActivityTicketResult>({
    url: Api.activityticketDetail,
    data: {
      id
    }
  })
}

/**
 * @description 活动创建子订单
 * @date 28/06/2024
 * @export
 * @param {ActivityCreateSuborderData} data
 */
export function activityCreateSuborder(data: ActivityCreateSuborderData) {
  return defHttp.post<{ id: number }>({
    url: Api.activityCreateSuborder,
    data
  })
}

/**
 * @description 活动创建支付订单
 * @date 28/06/2024
 * @export
 * @param {number} id
 */
export function activityCreateorder(id: number) {
  return defHttp.post<{ payCode: string, orderCode: string, payMoney: number }>({
    url: Api.activityCreateorder,
    data: {
      id
    }
  })
}

/**
 * @description 报名表单信息暂存
 * @date 01/07/2024
 * @export
 * @param {number} activityId
 * @param {string} dataJson
 */
export function setHoldRegisterInfo(activityId: number, dataJson: string) {
  return defHttp.post({
    url: Api.setHoldRegisterInfo,
    data: {
      activityId, dataJson
    }
  })
}

/**
 * @description 获取暂存表单信息
 * @date 01/07/2024
 * @export
 * @param {number} activityId
 */
export function getHoldRegisterInfo(activityId: number) {
  return defHttp.get<string>({
    url: Api.getHoldRegisterInfo + `/${activityId}`
  })
}

/**
 * @description 活动报名订单 - 取消活动报名
 * @date 28/08/2024
 * @export
 * @param {{ registerId: number, remarks: string }} data
 */
export function activityRegisterOrderCancelRegister(data: { registerId: number, remarks: string }) {
  return defHttp.post({
    url: Api.activityRegisterOrderCancelRegister,
    data
  })
}

/**
 * @description 我的活动报名 - 取消活动报名
 * @date 28/08/2024
 * @export
 * @param {{ registerId: number, remarks: string }} data
 */
export function cancelActivityRegister(data: { registerId: number, remarks: string }) {
  return defHttp.post({
    url: Api.cancelActivityRegister,
    data
  })
}

/**
 * @description 活动管理 - 取消报名
 * @date 04/07/2024
 * @export
 * @param {number} registerId
 */
export function activityManagerCancelSysRegistration(data: { registerId: number, remarks: string }) {
  return defHttp.post({
    url: Api.activityManagerCancelSysRegistration,
    data
  })
}

/**
 * @description 订单 - 获取活动报名表单信息
 * @date 02/07/2024
 * @export
 * @param {number} id
 */
export function registerPayFormInfo(id: number) {
  return defHttp.get<RegisterPayFormInfoResult>({
    url: Api.registerPayFormInfo + `/${id}`
  })
}

/**
 * @description 我的活动 - 获取活动报名表单信息
 * @date 03/07/2024
 * @export
 * @param {number} id
 */
export function activityRegisterFormInfo(id: number) {
  return defHttp.get<RegisterPayFormInfoResult>({
    url: Api.activityRegisterFormInfo + `/${id}`
  })
}

/**
 * @description 我的活动 - 报名详情
 * @date 03/07/2024
 * @export
 * @param {number} registerId
 */
export function registerDetail(registerId: number) {
  return defHttp.post<RegisterDetailResult>({
    url: Api.registerDetail + `/${registerId}`
  })
}

/**
 * @description 活动管理 - 报名详情
 * @date 04/07/2024
 * @export
 * @param {number} registerId
 */
export function activityManagerRegisterDetail(registerId: number) {
  return defHttp.post<RegisterDetailResult>({
    url: Api.activityManagerRegisterDetail + `/${registerId}`
  })
}

/**
 * 退费申请详情
 * @param registerId
 * @returns
 */
export function selectRefundApplyDetail(registerId: number) {
  return defHttp.get<RegisterDetailResult>({
    url: Api.selectRefundApplyDetail + `/${registerId}`
  })
}

/**
 * @description 活动管理 - 打印机列表
 * @date 04/07/2024
 * @export
 */
export function activityManagerDeviceActList(data: { activityId: number } & IQuery) {
  return defHttp.get<IResData<ActivityManagerDeviceActListResult>>({
    url: Api.activityManagerDeviceActList,
    data
  })
}

/**
 * @description 活动管理 - 打印胸卡
 * @date 04/07/2024
 * @export
 * @param {{
 *   activityId: number,
 *   registerId: number,
 *   equipmentNumber: string
 * }} data
 */
export function activityManagerPrintChestCard(data: {
  activityId: number,
  registerId: number,
  equipmentNumber: string
}) {
  return defHttp.post({
    url: Api.activityManagerPrintChestCard,
    data
  })
}

/**
 * @description 活动管理 - 核销签到
 * @date 05/07/2024
 * @export
 * @param {ActivityManagerScanVerification} data
 */
export function activityManagerScanVerification(data: ActivityManagerScanVerification) {
  return defHttp.post<{ id: number, ticketName: string }>({
    url: Api.activityManagerScanVerification,
    data
  })
}

/**
 * @description 活动签到 - 获取自主签到方式列表
 * @date 05/07/2024
 * @export
 * @param {number} activityId
 */
export function activityGetSignTypes(activityId: number) {
  return defHttp.post<ActivityGetSignTypesResult>({
    url: Api.activityGetSignTypes + `/${activityId}`
  })
}

/**
 * @description 活动签到 - 用户自主签到
 * @date 05/07/2024
 * @export
 * @param {ActivityScanVerificationData} data
 */
export function activityScanVerification(data: ActivityScanVerificationData) {
  return defHttp.post<ActivityScanVerificationResult>({
    url: Api.activityScanVerification,
    data
  })
}

/**
 * @description 用户自主核销后签到
 * @date 05/07/2024
 * @export
 * @param {ActivitySignImgeData} data
 */
export function activitySignImge(data: ActivitySignImgeData) {
  return defHttp.post<{ activityArrangeList: FindActivityArrangeListResult[] }>({
    url: Api.activitySignImge,
    data
  })
}

/**
 * @description 根据活动获取订单列表
 * @date 25/07/2024
 * @export
 * @param {IQuery} data
 */
export function appUserOrderActivityPageList(data: MyOrderListData) {
  return defHttp.post<IResData<MyOrderListReslut>>({
    url: Api.appUserOrderActivityPageList,
    data
  })
}

/**
 * @description 查询当前用户的报名信息
 * @date 30/07/2024
 * @export
 */
export function uniongetOrderCode(orderCode: string) {
  return defHttp.get<UniongetOrderCodeResult>({
    url: Api.uniongetOrderCode + `/${orderCode}`,
  })
}

/**
 * 查询排行列表
 * @param data
 * @returns
 */
export function getRankList(data: IRankListQuery, roleType: RoleType) {
  return defHttp.get<IRankList[]>({
    url: roleType === RoleType.USER ? Api.getRankList_user : Api.getRankList_admin,
    data
  })
}


/**
 * 浏览记录
 * @param data
 * @returns
 */
export function activityManagerBrowseList(data: IActivityManagerBrowseListQuery) {
  return defHttp.get<IResData<IActivityManagerBrowseList>>({
    url: Api.activityManagerBrowseList,
    data
  })
}
/**
 * 浏览记录详情列表
 * @param appUserInfoId
 * @returns
 */
export function browseDetailList(data: IBrowseListDetailQuery) {
  return defHttp.get<IResData<BrowseDetailList>>({
    url: Api.browseDetailList,
    data
  })
}

/**
 * 退票审核
 * @param data
 * @returns
 */
export function auditRegisterRefundApply(data: IAuditRegisterRefundApplyQuery) {
  return defHttp.post({
    url: Api.auditRegisterRefundApply,
    data
  })
}

/**
 * 我的邀约详情统计
 * @param data
 * @returns
 */
export function detailCount(activityId: number) {
  return defHttp.get<DetailCount>({
    url: Api.detailCount,
    data: { activityId }
  })
}

/**
 * 活动管理邀约详情统计
 * @param activityId
 * @param appUserInfoId
 * @returns
 */
export function activityManagerDetailCount(activityId: number, appUserInfoId: number) {
  return defHttp.get<DetailCount>({
    url: Api.activityManagerDetailCount,
    data: { activityId, appUserInfoId }
  })
}

/**
 * 我的邀约详情统计列表
 * @param activityId
 * @returns
 */
export function activityInviteDetailList(data: ActivityInviteDetailListQuery) {
  return defHttp.get<IResData<InviteDetailList>>({
    url: Api.activityInviteDetailList,
    data
  })
}

/**
 * 邀请详情-浏览记录
 * @param data
 * @returns
 */
export function activityManagerInviteBrowseList(data: ActivityInviteDetailListQuery) {
  return defHttp.get<IResData<ActivityManageInviteDetailList>>({
    url: Api.activityManagerInviteBrowseList,
    data
  })
}

/**
 * 邀请详情-报名记录
 * @param data
 * @returns
 */
export function activityManagerRegistersList(data: ActivityInviteDetailListQuery) {
  return defHttp.get<IResData<ActivityManageInviteDetailList>>({
    url: Api.activityManagerRegistersList,
    data
  })
}

/**
 * 待审核数量
 * @param data
 * @returns
 */
export function getAuditCount(activityId: number) {
  return defHttp.get<IReviewNum>({
    url: Api.auditCount,
    data: { activityId }
  })
}

/**
 * @description 活动管理代签到
 * @date 20/08/2024
 * @export
 * @param {IActivityReplaceSignData} data
 */
export function activityReplaceSign(data: IActivityReplaceSignData) {
  return defHttp.post({
    url: Api.activityReplaceSign,
    data
  })
}

/**
 * @description 小程序自主签到 - 搜索姓名/单位名称的列表
 * @date 28/08/2024
 * @export
 * @param {ISearchRegisterListData} data
 */
export function searchRegisterList(data: ISearchRegisterListData) {
  return defHttp.post<ISearchRegisterListResult[]>({
    url: Api.searchRegisterList,
    data
  })
}

/**
 * @description 报名取消记录 - 用户
 * @date 28/08/2024
 * @export
 * @param {number} registerId
 */
export function activityCancelRecord(registerId: number) {
  return defHttp.get<IActivityCancelRecordResult[]>({
    url: Api.activityCancelRecord + `/${registerId}`,
  })
}

/**
 * @description 报名取消记录 - 管理员
 * @date 28/08/2024
 * @export
 * @param {number} registerId
 */
export function sysActivityCancelRecord(registerId: number) {
  return defHttp.get<IActivityCancelRecordResult[]>({
    url: Api.sysActivityCancelRecord + `/${registerId}`,
  })
}

/**
 * @description 获取活动人脉的展示列表
 * @date 28/08/2024
 * @export
 * @param {IActivityRegisterQuery} data
 */
export function getShowRegisterList(data: IActivityRegisterQuery) {
  return defHttp.post<IActivityRegister[]>({
    url: `${Api.getShowRegisterList}?current=${data.current}&size=${data.size}`,
    data
  })
}
/**
 * 获取当前展示的用户
 * @param activityId
 * @returns
 */
export function getShowRegisterInfo(activityId: number) {
  return defHttp.get<IActivityRegister[]>({
    url: Api.getShowRegisterInfo + '/' + activityId,
  })
}

/**
 * 设置展示类型
 * @param activityId
 * @param registerId
 * @returns
 */
export function switchingMode(activityId: number, showModeEnum: ShowModeEnum) {
  return defHttp.post({
    url: `${Api.switchingMode}/${activityId}/${showModeEnum}`,
  })
}

/**
 * 设置展示人脉列表信息
 * @param activityId
 * @param registerId
 * @returns
 */
export function setShowRegisterInfo(activityId: number, registerId: number) {
  return defHttp.post({
    url: Api.setShowRegisterInfo,
    data: { activityId, registerIds: [registerId] }
  })
}

/**
 * 获取大屏配置信息
 * @param activityId
 * @returns
 */
export function getBigScreenConfig(activityId: number) {
  return defHttp.get<IBigScreenConfig>({
    url: `${Api.getBigScreenConfig}/${activityId}`,
  })
}

/**
 * 查询人脉列表
 * @param data
 * @returns
 */
export function getAppUserConnectionSquare(data: IActivityRegisterQuery) {
  return defHttp.post<IResData<RegisterIdAppUserInfo>>({
    url: `${Api.appUserConnectionSquare}?current=${data.current}&size=${data.size}`,
    data
  })
}

/**
 * 人脉大屏刷新
 * @param actiityId
 * @returns
 */
export function setRedisActivityBIRegisterList(actiityId: number) {
  return defHttp.post({
    url: `${Api.setRedisActivityBIRegisterList}/${actiityId}`,
  })
}

/**
 * 获取号码选择列表
 * @export
 * @param {string} region - 号码归属地
 * @param {string} packagecode - 套餐编码
 * @param {number} page
 * @param {string} sysUserName - 系统用户名
 * @returns {*}  {Promise<any>}
 */
export function chooseNumberList(region: string, packagecode: string, page: number, sysUserName: string): Promise<any> {
  return defHttp.get({
    url: Api.chooseNumberList,
    data: { region, packagecode, page, sysUserName }
  },{
    isRequestTransform: true,
  });
}

/**
 * 确认领取移动卡
 * @export
 * @param {Object} data
 * @returns {*}  {Promise<any>}
 */
export function receiptYDCard(data: {
  areaCode: string,
  areaName: string,
  servnumber: string,
  userName: string,
  telno: string,
  cerNo: string,
  province: string,
  addressCity: string,
  addressArea: string,
  address: string,
  mainprodid: string,
  mainprodname: string,
  referenceNumber?: string,
  isReadAgree: number,
  sysUserName: string,
  inviterKey: string,
}): Promise<any> {
  return defHttp.post({
    url: Api.addWorker,
    data,
  },{
    isRequestTransform: true,
  });
}